package com.learn.practice.liteflow;

import com.ql.util.express.DefaultContext;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class StepB extends NodeComponent {
    @Override
    public void process() throws Exception {
        UserContext userContext = this.getContextBean(UserContext.class);

        userContext.setUserName("zhangsan");
        String param = this.getRequestData();

        log.info("step b param:{}", param);

        log.info("step b processed");
    }

    @Override
    public void onSuccess() throws Exception {
//        DefaultContext context = this.getContextBean(DefaultContext.class);
        //do your biz
    }

    @Override
    public void onError() throws Exception {
//        DefaultContext context = this.getContextBean(DefaultContext.class);
        //do your biz
    }
}
